package com.moli.iov.admin.service.impl;

import com.moli.iov.admin.model.vo.req.PermissionVo;
import com.moli.iov.admin.service.IPermissionFacadeService;
import com.moli.iov.rest.RestResponse;
import com.moli.iov.sys.model.dto.req.PermissionDto;
import com.moli.iov.sys.model.po.Permission;
import com.moli.iov.sys.remote.IPermissionRemoteService;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 权限业务
 * </p>
 *
 * @author zql
 * @since 2019/9/25 17:17
 */
@Slf4j
@Service
public class PermissionFacadeServiceImpl implements IPermissionFacadeService {

  @Reference(group = "${service.group}", check = false)
  private IPermissionRemoteService permissionRemoteService;

  /**
   * 根据用户类型查询全部权限
   * @param permissionVo
   * @return
   */
  @Override
  public RestResponse<List<Permission>> listAllPermissionNeApi(PermissionVo permissionVo) {
    PermissionDto permissionDto = new PermissionDto();
    permissionDto.setSysUserType(permissionVo.getSysUserType());
    permissionDto.setSysUserId(permissionVo.getSysUserId());
    return permissionRemoteService.listAllPermissionNeApi(permissionDto);
  }
}
